package com.itheima.d14_extends_constructor.test;

class Teacher extends People {
    private String skill;

    public Teacher(){
        //默认会有super() 调用父类无参构造方法
        //也可以super调用父类有参构造，但必须在第一句代码处写
        super("张三",18);
        System.out.println("子类构造方法执行");
    }


    public Teacher(String skill) {
        this.skill = skill;
    }

    public Teacher(String name, int age, String skill) {
        super(name, age);//调用父类构造器
        this.skill = skill;
    }

    public String getSkill() {
        return skill;
    }

    public void setSkill(String skill) {
        this.skill = skill;
    }
}

